/*
 * @Author: your name
 * @Date: 2021-08-16 15:26:03
 * @LastEditTime: 2022-02-09 17:11:30
 * @LastEditors: jgg
 * @Description: In User Settings Edit
 * @FilePath: \yyzxwebd:\hsx\水文局设备运行维护管理平台\web\src\api\safeGuardList.js
 */
import request from '../utils/request'

const user = {}



// 企业管理列表
user.getCompanyList = (params) => {
    return request({
        url: `/xfys/enterprisezf/findByPageList`,
        method: 'get',
        params
    })
}

// 企业管理详情
user.getCompanyDetail = (params) => {
    return request({
        url: `/xfys/enterprisezf/findById`,
        method: 'get',
        params
    })
}

// 企业管理删除
user.delCompany = (params) => {
    return request({
        url: `/xfys/enterprisezf/del`,
        method: 'get',
        params
    })
}

// 企业管理新增/编辑
user.saveCompany = (data) => {
    return request({
        url: `/xfys/enterprisezf/saveOrUpdate`,
        method: 'post',
        data
    })
}

// 企业管理下载
user.downloadCompanyList = () => {
    return request({
        url: `/xfys/enterprisezf/excelTemp`,
        method: 'get',
        params: {},
        responseType: 'blob'
    })
}


// 组织结构查询分页
user.getDeptList = (params) => {
    return request({
        url: `/xfys/web/sys/dept/list/current/${params.current}/pageSize/${params.pageSize}`,
        method: 'get',
        params:''
    })
}

// 组织机构下拉框数据
user.getlistCombobox = () => {
    return request({
        url: `/system/dept/listCombobox`,
        method: 'get',
        params: {}
    })
}
// 角色下拉框数据
user.getlistRolebox = (params) => {
    return request({
        url: `/system/role/listCombobox`,
        method: 'get',
        params:params
    })
}


// 菜单列表
user.cdMenuList = (params) => {
    return request({
        url: `/system/menu/getMenu`,
        method: 'get',
        params:''
    })
}

// 根据id查询菜单
user.getRoleData = (params) => {
    return request({
        url: `/system/role/getInfo?id=${params.id}`,
        method: 'get',
        params:''
    })
}

// 角色查询分页
user.getRoleList = (params) => {
    return request({
        url: `/system/role/getRolePage`,
        method: 'get',
        params:params
    })
}
// 角色修改
user.roleUpdate = (params) => {
    return request({
        url: `/system/role/save`,
        method: 'post',
        data: params
    })
}
// 角色新增
user.roleSave = (params) => {
    return request({
        url: `/system/role/save`,
        method: 'post',
        data: params
    })
}
// 角色删除
user.roleDelete = (params) => {
    return request({
        url: `/system/role/deleteById/?id=${params.id}`,
        method: 'delete'
    })
}


// 用户编辑更新
user.userUpdate = (params) => {
    return request({
        url: `/system/sysuser/updateUser`,
        method: 'post',
        data: params
    })
}
// 新增用户
user.userSave = (params) => {
    return request({
        url: `/system/sysuser/addUser`,
        method: 'post',
        data: params
    })
}
// 用户重置密码
user.RestPassword = (params) => {
    return request({
        url: `/system/sysuser/restpassword`,
        method: 'post',
        params
    })
}
// 用户查询分页
user.getUserList = (params) => {
    return request({
        url: `/system/sysuser/getUserPage`,
        method: 'get',
        params:params
    })
}

// 角色详情
user.userDetail = (id) => {
    return request({
        url: `/system/sysuser/getInfo?id=${id}`,
        method: 'get',
        params: ''
    })
}

// 组织结构查询分页
user.getDeptList = (params) => {
    return request({
        url: `/xfys/web/sys/dept/list/current/${params.current}/pageSize/${params.pageSize}`,
        method: 'get',
        params:''
    })
}
// 组织机构修改
user.deptUpdate = (params) => {
    return request({
        url: `/xfys/web/sys/dept/update/${params.id}`,
        method: 'put',
        data: params
    })
}
// 组织机构新增
user.deptSave = (params) => {
    return request({
        url: `/xfys/web/sys/dept/save`,
        method: 'post',
        data: params
    })
}
// 组织机构删除
user.deptDelete = (params) => {
    return request({
        url: `/xfys/web/sys/dept/delete//${params.id}`,
        method: 'delete'
    })
}

// 操作日志
user.getList = (params) => {
    let chaxun = {
        name:params.name,
        startTime:params.startTime,
        endTime:params.endTime
    }
    return request({
        url: `/xfys/web/sys/log/list/current/${params.current}/pageSize/${params.pageSize}`,
        method: 'get',
        params:chaxun
    })
}

// 字典查询
user.getByType = (params) => {
    return request({
        url: '/xfys/web/sys/dict/getByType',
        method: 'get',
        params:params
    })
}

// 字典下拉
user.getDictListlet = (params) => {
    return request({
        url: `/xfys/web/sys/dict/list`,
        method: 'post',
        params:''
    })
}
// 字典查询分页
user.getDictList = (params) => {
    return request({
        url: `/xfys/web/sys/dict/findDict/current/${params.current}/pageSize/${params.pageSize}`,
        method: 'get',
        params:''
    })
}
// 字典删除
user.deleteDict = (params) => {
    return request({
        url: `/xfys/web/sys/dict/deleteDict`,
        method: 'get',
        params:params
    })
}
// 字典保存
user.saveDict = (params) => {
    return request({
        url: `/xfys/web/sys/dict/saveDict`,
        method: 'post',
        data: params
    })
}
// 字典修改
user.updateDict = (params) => {
    return request({
        url: `/xfys/web/sys/dict/updateDict`,
        method: 'post',
        data: params
    })
}
// 短信根据部门id查询用户
user.getDeptUser = (params) => {
    return request({
        url: `/xfys/config/receiver/getDeptUser`,
        method: 'get',
        params:params
    })
}
// 短信查询分页
user.getListReceiver = (params) => {
    return request({
        url: `/xfys/config/receiver/listReceiver`,
        method: 'get',
        params:params
    })
}
// 短信删除
user.deleteReceiver = (params) => {
    return request({
        url: `/xfys/config/receiver/listReceiver1`,
        method: 'get',
        params:params
    })
}
// 短信保存
user.saveReceiver = (params) => {
    return request({
        url: `/xfys/config/receiver/saveReceiver`,
        method: 'post',
        data: params
    })
}
// 短信修改
user.updateReceiver = (params) => {
    return request({
        url: `/xfys/config/receiver/updateReceiver`,
        method: 'post',
        data: params
    })
}
export default user